<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css">
<style type="text/css">

</style>
<script type="text/javascript" language="javascript"><!--

	function showHidden(fatherId,obj){
		var fadiv=document.getElementsByTagName("div");
		var sondiv = document.getElementById("f"+fatherId);
		var faspan = document.getElementById("span"+fatherId);
		
		var flag=0;
		if(sondiv.style.display == ""){
			flag=1;
		}
		for(var i = 0; i < fadiv.length; i++){
			if(fadiv[i].id != "fa"){
				fadiv[i].style.display = "none";
			}
		}
		if(flag==0){
			sondiv.style.display = "";
			//img.src = "./img/icon_02.jpg";
			faspan.innerText = "→";//收起
			faspan.style.color = "red";
			faspan.style.fontSize = "12px";
			
			var cspan = "span"+fatherId;
			var hspan = document.getElementsByTagName("span");
			for(var i = 0; i < hspan.length; i++){
				if(hspan[i].id != cspan){
					hspan[i].innerText = "展开";
					hspan[i].style.color = "#6DB7C9";
					hspan[i].style.fontSize = "10px";
				}
			}
		}else{
			faspan.innerText = "展开";
			faspan.style.color = "#6DB7C9";
			faspan.style.fontSize = "10px";
		}
		
		changeBackground1(obj);
	}
	
	function changeBackground1(obj){
		var asons = document.getElementsByName("fa");
		for(var i = 0; i < asons.length; i++){
			if(asons[i] == obj){
				/**asons[i].style.backgroundColor = "#E7EBEC";
				asons[i].style.backgroundImage = "url('./images/nav2.bmp')";
				asons[i].style.backgroundRepeat="no-repeat";*/
				asons[i].style.color = "#000000";
				asons[i].style.fontWeight = "bold";
			}else{
				/**asons[i].style.backgroundColor = "#F6F7F9";
				asons[i].style.backgroundImage = "url('./images/nav2.bmp')";
				asons[i].style.backgroundRepeat="no-repeat";*/
				asons[i].style.color = "";
				asons[i].style.fontWeight = "";
			}
		}
	}

	function changeBackground(obj){
		var asons = document.getElementsByName("ason");
		for(var i = 0; i < asons.length; i++){
			if(asons[i] == obj){
				/**asons[i].style.backgroundColor = "#E7EBEC";
				asons[i].style.backgroundImage = "url('./images/nav2.bmp')";
				asons[i].style.backgroundRepeat="no-repeat";*/
				asons[i].style.color = "red";
				asons[i].style.fontWeight = "bold";
				/**asons[i].style.backgroundColor = "#D0E7EF";**/
			}else{
				/**asons[i].style.backgroundColor = "#F6F7F9";
				asons[i].style.backgroundImage = "url('./images/nav2.bmp')";
				asons[i].style.backgroundRepeat="no-repeat";*/
				asons[i].style.color = "";
				asons[i].style.fontWeight = "";
				/**asons[i].style.backgroundColor = "";**/
			}
		}
	
	}
	function mouseover(obj){
		obj.style.backgroundColor = "#D0E7EF";
		//style="background: url('images/${sFunction.functionNameEn}.bmp') no-repeat 30px 10px;color: #000000;" onmouseover="mouseover(this);" onmouseout="mouseout(this);"
	}
	function mouseout(obj){
		obj.style.backgroundColor = "";
	}

--></script>
</head>
<body>
	
	<div id="fa" style="background: url('./images/nav_bg.bmp');height: 90px;">
		<div id="fa" class="a_detail" style="position: absolute;left: 36px;top: 34px;">
			<a href="./internalMailbox.do" target="main" hidefocus="true">${noReadNum}&nbsp;条未读信息</a>
		</div>
	</div>
	
	<c:forEach var="function" items="${functions}">
	<c:if test="${function.parentId == 0}">
	<div id="fa" class="left_div1" onclick="showHidden(${function.id},this)">
		<a href="#" hidefocus="true">
			<c:choose>
				<c:when test="${language == 2}">${function.functionNameEn}</c:when>
				<c:otherwise>${function.functionName}</c:otherwise>
			</c:choose>
			<span id="span${function.id}" style="font-size: 10px;font-weight: normal;position: absolute;right: 5px;color: #6DB7C9;">展开</span>
		</a>
	</div>
	
	<div class="left_div2" id="f${function.id}" style="display: none;">
	   
	<c:forEach var="sFunction" items="${functions}">
	<c:if test="${sFunction.parentId == function.id}">
		<a id="ason"  href="${sFunction.url}" target="main" hidefocus="true" onclick="changeBackground(this);" >
			<c:choose>
				<c:when test="${language == 2}">${sFunction.functionNameEn}</c:when>
				<c:otherwise>${sFunction.functionName}</c:otherwise>
			</c:choose>
		</a>
		<c:if test="${sFunction.functionCode == 'DeptAllCustomer' 
			|| sFunction.functionCode == 'AddLinkman' 
			|| sFunction.functionCode == 'OpenCustomer' 
			|| sFunction.functionCode == 'NearUpdateCustomer' 
			|| sFunction.functionCode == 'SalesFunnel' 
			|| sFunction.functionCode == 'DeptCloseSalesRecord' 
			|| sFunction.functionCode == 'AddSalesRecord' 
			|| sFunction.functionCode == 'NearFollowSaleRecord' 
			|| sFunction.functionCode == 'DeptReceivable' 
			|| sFunction.functionCode == 'AddBackCost' 
			|| sFunction.functionCode == 'DeptAuditContractRecord' 
			|| sFunction.functionCode == 'AuditDynamic'
			|| sFunction.functionCode == 'CloseSaleRecord'
			|| sFunction.functionCode == 'CustomerLinkman'
			|| sFunction.functionCode == 'AllLinkman'}">
			<hr>
		</c:if>
	</c:if>
	</c:forEach>
	</div>
	
	</c:if>
	</c:forEach>
</body>
</html>